
$(function(){
    //婢舵挳鍎�??佃壈鍩卙over閺佸牊鐏夐敍?
    (function($){
        var oListH=$('#listH');
        var aList=oListH.find('a');

        aList.click(function(){
            /*alert('�?惰棌');*/
            aList.removeClass('nav_show');
            $(this).addClass('nav_show');
        });

        aList.mouseover(function(){
            /*alert('�?惰棌');*/
            $(this).css('background','#55c8fb');
        });

        aList.mouseout(function(){
            /*alert('�?惰棌');*/
            $(this).css('background','');
        });
    })(jQuery);

    // banner;
    (function($){
        $.fn.plugIn=function(){
            var oBanAct=$('#banAct');
            var aBanShow=oBanAct.find('li');
            var aBanCli=oBanAct.find('i');
            var now=0;

            aBanCli.click(function(){
                now=$(this).index();
                tab();
            });

            var timer=setInterval(next, 6000);

            oBanAct.mouseover(function(){
                clearInterval(timer);
            });

            oBanAct.mouseout(function(){
                timer=setInterval(next, 6000);
            });

            /*鐠嬪啰鏁n*/
            function tab(){
                aBanCli.removeClass('listAShow');
                aBanCli.eq(now).addClass('listAShow');
                aBanShow.hide();
                aBanShow.eq(now).show();
                aBanShow.eq(now).animate({'opacity':0.6},0);
                aBanShow.eq(now).animate({'opacity':1},500)
            }
            function next(){
                now++;
                if(now==aBanCli.length){
                    now=0;
                }
                tab();
            }
        };

        $(function(){
            $('#banAct').plugIn();
        });

    })(jQuery);

    //闂嗗棗娲熺憰�??�?? / NEWS
    (function($){
        var aShow=$('#contShow1 li');
        var aActive=$('.cont_l_2list a');
        var now=0;
        var n=0;

        aActive.click(function(){
            now=$(this).index();
            tab();
        });

        var timer=setInterval(next,4000);

        var oBanAct= $('#contShow1');
        oBanAct.mouseover(function(){
            clearInterval(timer);
        });
        oBanAct.mouseout(function(){
            timer=setInterval(next,4000);

        });

        function tab(){
            n++;
            aActive.removeClass('cont2_show');
            aActive.eq(now).addClass('cont2_show');
            aShow.eq(now).css('opacity',0);
            aShow.eq(now).animate({opacity:'1'},1500);
            aShow.eq(now).css('z-index',n);
        }

        function next(){
            now++;
            n++;
            if(now==aActive.length){
                now=0;
            }
            tab();
        }

    })(jQuery);

    ;(function($){
        var oShow=$('#cl3new');
        var aShow=oShow.find('li');

        aShow.mouseover(function(){
            $(this).addClass('show');
        });
        aShow.mouseout(function(){
            $(this).removeClass('show');
        });
    })(jQuery);

    // 閻欘剙顔嶇粵鏍у灊
    ;(function($){
        var aActive=$('#l4aList div');
        var aShow=$('#l4aBox div');

        aActive.click(function(){
            aActive.removeClass('listLCli');
            $(this).addClass('listLCli');
            aShow.removeClass('l4aShow');
            aShow.eq($(this).index()).addClass('l4aShow');
        });
    })(jQuery);

    // 閻欘剙顔嶇粵鏍у灊
    ;(function($){
        var aShow=$('#l4aLone dl');
        var aActive=$('#l4aLone li');

        aActive.mouseover(function(){
            aActive.removeClass('listLi');
            $(this).addClass('listLi');
            aShow.removeClass('showDl');
            aShow.eq($(this).index()).addClass('showDl');
        });
    })(jQuery);

    // 閻欘剙顔嶇粵鏍у灊
    ;(function($){
        var aShow=$('#l4aLone1 dl');
        var aActive=$('#l4aLone1 li');

        aActive.mouseover(function(){
            aActive.removeClass('listLi');
            $(this).addClass('listLi');
            aShow.removeClass('showDl');
            aShow.eq($(this).index()).addClass('showDl');
        });
    })(jQuery);

    // 缂佺厧鎮庨弬浼存�? / NEWS
    ;(function($){
        var oL=$('#xNewB');
        var oR=$('#xNewS');
        var aShow7=$('#xNwe ul');
        var now=0;

        oR.mouseover(function(){
            $(this).addClass('sg');
        });
        oR.mouseout(function(){
            $(this).removeClass('sg');
        });

        oL.mouseover(function(){
            $(this).addClass('bg');
        });
        oL.mouseout(function(){
            $(this).removeClass('bg');
        });

        oR.click(function(){
            now++;
            if(now == aShow7.length){
                now=0;
            }
            aShow7.removeClass('xNweShow');
            aShow7.eq(now).addClass('xNweShow');
        });

        oL.click(function(){
            now--;
            if(now == -1){
                now=aShow7.length-1;
            }
            aShow7.removeClass('xNweShow');
            aShow7.eq(now).addClass('xNweShow');
        });
    })(jQuery);

    // �??鍙ョ窗鐠愶絼鎹
    ;(function($){
        $('.content5 li').mouseover(function(){
            $(this).addClass('cli5');
        });
        $('.content5 li').mouseout(function(){
            $(this).removeClass('cli5');
        });
    })(jQuery);

    // dFix
    ;(function($){
        var aFixA=$('#dFix li');
        var aFixAll=$('#dFix li a');
        var aFixP=$('#dFix .L1 p');
        var aFixImg=$('#dFix .L2 img');
        var aFixI3=$('#dFix .L3 .a3 i');

        aFixAll.mouseover(function(){
            $(this).css('background','#00a0e9');
        });
        aFixAll.mouseout(function(){
            $(this).css('background','#d2d2d2');
        });

        aFixA.eq(0).mouseover(function(){
            aFixP.css('display','block');
        });
        aFixA.eq(0).mouseout(function(){
            aFixP.css('display','none');
        });

        aFixA.eq(1).mouseover(function(){
            aFixImg.css('display','block');
        });
        aFixA.eq(1).mouseout(function(){
            aFixImg.css('display','none');
        });

        aFixA.eq(2).mouseover(function(){
            aFixI3.addClass('iShow');
        });
        aFixA.eq(2).mouseout(function(){
            aFixI3.removeClass('iShow');
        });

    })(jQuery);
});

window.onload=function(){
    (function(){
        var oBScroll=document.getElementById('scroll');
        var oPre=document.getElementById('clickP');
        var oNext=document.getElementById('clickN');

        var oBBox=document.getElementById('bMax');
        var oBText=document.getElementById('bText');
        /*var maxContTop=oBText.offsetHeight-parseInt(getStyle(oBBox,'height'));*/
        var maxContTop=oBText.offsetHeight-oBBox.offsetHeight;
        var maxSTop=oBScroll.parentNode.offsetHeight-oBScroll.offsetHeight;
        var top=0;

        oBScroll.onmousedown=function(ev){
            var oEvent=ev || event;
            var disY=oEvent.clientY-oBScroll.offsetTop;

            document.onmousemove=function(ev){
                var oEvent=ev || event;
                top=oEvent.clientY-disY;

                if(top<0){
                    top=0;
                }else if(top>maxSTop){
                    top=maxSTop;
                }
                oBScroll.style.top=top+'px';
                var nContTop=top/maxSTop*maxContTop;
                oBText.style.top=-(nContTop)+'px';
            };

            document.onmouseup=function(){
                document.onmousemove=null;
                document.onmouseup=null;

                oBScroll.releaseCapture && oBScroll.releaseCapture();
            };
            oBScroll.setCapture && oBScroll.setCapture();
            return false;
        };

        oNext.onmousedown=function(){
            top+=40;

            if(top>maxSTop){
                top=maxSTop;
            }
            oBScroll.style.top=top+'px';
            var nContTop=top/maxSTop*maxContTop;
            oBText.style.top=-(nContTop)+'px'
        };

        oPre.onmousedown=function(){
            top-=40;

            if(top<0){
                top=0;
            }
            oBScroll.style.top=top+'px';
            var nContTop=top/maxSTop*maxContTop;
            oBText.style.top=-(nContTop)+'px'
        };

        function getStyle(obj, sName){
            return (obj.currentStyle || getComputedStyle(obj, false))[sName];
        }
    })();

};




































